package com.minimalist.common.entity.basic.vo.dict;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.config.swagger.SchemaEnum;
import com.minimalist.common.entity.basic.enums.StatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * @author 11987
 */
@Schema(name = "字典管理实体")
public class DictVO implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "dictId", description = "字典ID", type = "string")
    private Long dictId;

    @Schema(name = "dictType", description = "字典类型", type = "string")
    private String dictType;

    @Schema(name = "dictKey", description = "字典key", type = "string")
    private String dictKey;

    @Schema(name = "dictValue", description = "字典value", type = "string")
    private String dictValue;

    @Schema(name = "dictName", description = "字典名称", type = "string")
    private String dictName;

    @Schema(name = "dictDesc", description = "字典描述", type = "string")
    private String dictDesc;

    @Schema(name = "dictOrder", description = "字典排序值", type = "integer")
    private Integer dictOrder;

    @Schema(name = "dictClass", description = "字典样式，对应前端Tag组件的type", type = "string")
    private String dictClass;

    @SchemaEnum(implementation = StatusEnum.class)
    @Schema(name = "status", description = "字典状态", type = "integer")
    private Integer status;

    public Long getDictId() {
        return dictId;
    }

    public void setDictId(Long dictId) {
        this.dictId = dictId;
    }

    public String getDictType() {
        return dictType;
    }

    public void setDictType(String dictType) {
        this.dictType = dictType;
    }

    public String getDictKey() {
        return dictKey;
    }

    public void setDictKey(String dictKey) {
        this.dictKey = dictKey;
    }

    public String getDictValue() {
        return dictValue;
    }

    public void setDictValue(String dictValue) {
        this.dictValue = dictValue;
    }

    public String getDictName() {
        return dictName;
    }

    public void setDictName(String dictName) {
        this.dictName = dictName;
    }

    public String getDictDesc() {
        return dictDesc;
    }

    public void setDictDesc(String dictDesc) {
        this.dictDesc = dictDesc;
    }

    public Integer getDictOrder() {
        return dictOrder;
    }

    public void setDictOrder(Integer dictOrder) {
        this.dictOrder = dictOrder;
    }

    public String getDictClass() {
        return dictClass;
    }

    public void setDictClass(String dictClass) {
        this.dictClass = dictClass;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DictVO dictVO = (DictVO) o;
        return Objects.equals(dictId, dictVO.dictId) &&
                Objects.equals(dictType, dictVO.dictType) &&
                Objects.equals(dictKey, dictVO.dictKey) &&
                Objects.equals(dictValue, dictVO.dictValue) &&
                Objects.equals(dictName, dictVO.dictName) &&
                Objects.equals(dictDesc, dictVO.dictDesc) &&
                Objects.equals(dictOrder, dictVO.dictOrder) &&
                Objects.equals(dictClass, dictVO.dictClass) &&
                Objects.equals(status, dictVO.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(dictId, dictType, dictKey, dictValue, dictName, dictDesc, dictOrder, dictClass, status);
    }

    @Override
    public String toString() {
        return "DictVO{" +
                "dictId=" + dictId +
                ", dictType='" + dictType + '\'' +
                ", dictKey='" + dictKey + '\'' +
                ", dictValue='" + dictValue + '\'' +
                ", dictName='" + dictName + '\'' +
                ", dictDesc='" + dictDesc + '\'' +
                ", dictOrder=" + dictOrder +
                ", dictClass='" + dictClass + '\'' +
                ", status=" + status +
                '}';
    }
}
